toOutcome

fun <E, A> Either<E, Option<A>>.toOutcome(): Outcome<E, A>(source)

An extension method on Either> that converts it to an Outcome.

Left("bad").toOutcome() // Failure("bad")
Right(None).toOutcome() // Absent
Right(Some("hi")).toOutcome() // Present("hi")

fun <A> Option<A>.toOutcome(): Outcome<Nothing, A>(source)